l1=[]
l2=[]
n=0
while True :
  s=input("输入任意行文字(直接回车结束输入):")
  if s == "" :
    break
  n+=1
  l1.append(s)
  l2.append(len(s))
l3=max(l2)+2
print('+'+'-'*l3+'+')
for i in  range(n):
   print('|'+l1[i].center(max(l2)+2)+'|')
print('+'+'-'*l3+'+')